package com.homelock.job;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@Configurable
@EnableScheduling
@EnableAsync
public class JobBeans {
	 
	Logger _log = LoggerFactory.getLogger(JobBeans.class);

	/**
     * 定时任务10分钟
     * 单位毫秒
     */
    @Async
    @Scheduled(fixedRate = 1000 * 60 * 30)
	public void m30() {
		_log.info(String.format("定时30分钟.开始"));
    }

	/**
     * 定时任务 每天8点
     * 单位毫秒
     */
    @Async
    @Scheduled(cron = "0 0 8 * * ?")
    public void everyDay8() {
    	_log.info("-----定时任务 每天8点---");
    }
}
